﻿using PMS.SANY.MonOrderServer.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PMS.SANY.MonOrderServer
{
    public class OrderInstance
    {
        /// <summary>
        /// PMS订单记录编号
        /// </summary>
        public string Id { set; get; }

        /// <summary>
        /// 订单编号
        /// </summary>
        public string WipOrderNo { set; get; }

        /// <summary>
        /// 当前工序顺序号
        /// </summary>
        public int CurrentStepIndex { private set; get; }

        /// <summary>
        /// 订单配置
        /// </summary>
        public OrderConfig Config { set; get; }

        /// <summary>
        /// 实例工序
        /// </summary>
        public Dictionary<int, OprSequenceIns> Steps { set; get; }

        public OrderInstance()
        {
            Steps = new Dictionary<int, OprSequenceIns>();
            CurrentStepIndex = 0;
        }


    }

    /// <summary>
    /// 工序信息
    /// </summary>
    public class OprSequenceIns
    {
        /// <summary>
        /// 工序编号
        /// </summary>
        public string Id { set; get; }

        /// <summary>
        /// 计划工序数量
        /// </summary>
        public decimal Quantity { set; get; }

        /// <summary>
        /// 实际完成数量
        /// </summary>
        public int ActQuantity { set; get; }

        /// <summary>
        /// 计划工位
        /// </summary>
        public string WorkStation { set; get; }

        /// <summary>
        /// 实际工位
        /// </summary>
        public string ActWorkStation { set; get; }

        /// <summary>
        /// 工序状态
        /// 110	已下达
        /// 120	已派工
        /// 121	派工失败
        /// 125	已接收
        /// 130	进行中
        /// 135	暂停
        /// 140	已完工
        /// 150	已报工
        /// 155	报工失败
        /// 160	取消报工
        /// 170	已删除
        /// </summary>
        public string ProgressStatus { set; get; }
    }
}
